﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display {
    import flash.events.*;
    import flash.display.*;

    public class ToolTip extends GameSprite {

        protected var m_generatorFn:Function;
        protected var m_owner:DisplayObject;
        protected var m_hidden:Boolean = false;

        public function ToolTip(_arg1:Function=null){
            this.m_generatorFn = _arg1;
        }
        public function attachToolTip(_arg1:DisplayObject):void{
            this.m_owner = _arg1;
            _arg1.addEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
            _arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
        }
        public function detachToolTip(_arg1:DisplayObject):void{
            this.m_owner = null;
            _arg1.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
            _arg1.removeEventListener(MouseEvent.ROLL_OUT, onRollOut);
        }
        override protected function onRollOver(_arg1:MouseEvent):void{
            if (this.m_generatorFn != null){
                this.toolTip = this.m_generatorFn();
            };
            if (!this.m_hidden){
                super.onRollOver(_arg1);
            };
        }
        public function get owner():DisplayObject{
            return (this.m_owner);
        }
        public function set hidden(_arg1:Boolean):void{
            this.m_hidden = _arg1;
        }

    }
}//package Display 
